import urllib.request
import random
##网页进不去 那咋办嘛！！！
url = 'http://myip.kkcha.com/'

iplist = ['211.161.245.123','180.97.190.162','221.226.15.100','113.91.210.139','112.103.188.156']

proxy_support = urllib.request.ProxyHandler({'http':random.choice(iplist)})

opener = urllib.request.build_opener(proxy_support)
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36')]

urllib.request.install_opener(opener)

response = urllib.request.urlopen(url)
html = response.read().decode('utf-8')
print(html)
